<template>
  <div class="car-body">
      <div class="car-card-center">
          <h3>Key Features</h3>
          <div class="car-card-all-div">
              <div class="car-card-div" v-for="item in choosecardmess" :key="item.id">
                    <div class="card-img-div">
                        <img :src="item.url" alt="">
                    </div>
                    <div class="card-message">
                        <h3 class="message-h3" v-html="item.cardtitle"></h3>
                        <h4 class="message-h3" v-html="item.cardmessage"></h4>
                    </div>
              </div>
          </div>
      </div>
  </div>
</template>

<script>
import { request } from 'network/request.js'

export default {
    props: {
        cardimglistnochoose: {
            type: Array,
            default: function () { return [] }
        },
        id: {
            type:String,
            default: 's1'
        }
    },
    data() {
        return {
            choosecardmess: [],
            cardid: this.id
        }
    },
    created() {
        request(this.cardid).then(res => {
            this.choosecardmess = res.data[0].cardimglist
        })
    }
}
</script>

<style lang="scss" scoped>
* {
    box-sizing: border-box;
}
img {
    width: 100%;
    height: 100%;
    vertical-align: top;
}
.car-body {
    width: 100%;
    //  background-color: blue;
}
.car-card-center {
    max-width: 1100px;
    /* height: 40px; */
    margin: 0 auto;
    /* background-color: lightskyblue; */
}
.car-card-center>h3 {
    text-align: center;
    color:#00142E;
    background-color: #fff;
    max-height:50px;
    font-size: 28px;
    font-weight: normal;
    font-style: italic;
    letter-spacing: 3px;
}
.car-card-all-div {
    /* width: 100%; */
    margin-top: 2%;
    /* overflow: hidden; */
}
.car-card-div {
    display: flex;
    width: 100%;
    margin-bottom: 2.5%;
    box-shadow: 3px 3px 15px #ccc;
    /* background-color: pink; */
}

.card-img-div {
    width: 40%;
    background-color: #000;
    /* display: inline-block; */
}
.card-img-div img {
    opacity: .6;
    transform-origin: center;
    transition: .5s linear;
}
.card-img-div:hover img {
    opacity: 1;
}
.card-message {
    width: 60%;
    padding-left: 2%;
    padding-top: 1%;
}
.card-message>h3 {
    color: #00142E;
    font-size: 24px;
    margin-bottom: 2%;
}
.card-message>h4 {
    color: #4d4d4d;
    width: 90%;
    line-height: 25px;
    /* background-color: #ccc; */
    font-size: 16px;
    letter-spacing: 1.5px
}

@media screen and (max-width: 768px) {
    .car-card-all-div {
        margin-top: 4%;
        /* display: flex; */
    }
    .car-card-div {
        width: 90%;
        flex-direction:column;
        /* display: block; */
        /* white-space: nowrap; */
        /* overflow: hidden; */
        /* float: left; */
        margin: 0 auto 7%;
        padding-bottom: 3%;
        // padding-left: 5%;
    }
    .card-img-div {
        width: 100%;
    }
    .card-message {
        width: 100%;
        padding-left: 3%;
        &>h4 {
            // padding-left: 2%;
            line-height: 2em;
            font-size: 14px;
        }
    }

}
</style>